home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / VideoFolder 1.0a / Source / MoreFiles 1.4.1 / MoreFiles.p < prev    next >
Text File  |  1995-12-21  |  25KB  |  648 lines

  1. UNIT MoreFiles;
  2.  
  3. {    Apple Macintosh Developer Technical Support                                }
  4. {                                                                            }
  5. {    The long lost high-level and FSSpec File Manager functions.                }
  6. {    by Jim Luther, Apple Developer Technical Support Emeritus                }
  7. {                                                                            }
  8. {    File:        MoreFiles.p                                                    }
  9. {                                                                            }
  10. {    Copyright © 1992-1995 Apple Computer, Inc.                                }
  11. {    All rights reserved.                                                    }
  12. {                                                                            }
  13. {    You may incorporate this sample code into your applications without        }
  14. {    restriction, though the sample code has been provided "AS IS" and the    }
  15. {    responsibility for its operation is 100% yours.  However, what you are    }
  16. {    not permitted to do is to redistribute the source as "DSC Sample Code"    }
  17. {    after having made changes. If you're going to re-distribute the source,    }
  18. {    we require that you make it clear in the source that the code was        }
  19. {    descended from Apple Sample Code, but that you've made changes.            }
  20.  
  21.  
  22. INTERFACE
  23.  
  24. USES
  25.     Files;
  26.  
  27. {***************************************************************************}
  28.  
  29.  
  30.     FUNCTION HGetVolParms (volName: StringPtr;
  31.                                     vRefNum: Integer;
  32.                                     VAR volParmsInfo: GetVolParmsInfoBuffer;
  33.                                     VAR infoSize: LongInt): OSErr;
  34. {    Use HGetVolParms to determine the characteristics of a volume.            }
  35. {    A result of paramErr usually just means the volume doesn't                }
  36. {    support PBHGetVolParms and the feature you were going to check            }
  37. {    for isn't available.                                                    }
  38. {                                                                            }
  39. {    volName            input:    A pointer to the name of a mounted volume        }
  40. {                            or nil.                                            }
  41. {    vRefNum            input:    Volume specification.                            }
  42. {    volParmsInfo    input:    Pointer to GetVolParmsInfoBuffer where the        }
  43. {                            volume attributes information is returned.        }
  44. {                    output:    Atributes information.                            }
  45. {    infoSize        input:    Size of buffer pointed to by volParmsInfo.        }
  46. {                    output: Size of data actually returned.                    }
  47.  
  48.  
  49. {***************************************************************************}
  50.  
  51.  
  52.     FUNCTION HCreateMinimum (vRefNum: Integer;
  53.                                     dirID: LongInt;
  54.                                     fileName: Str255): OSErr;
  55. {    Use HCreateMinimum to create a new file without attempting to set the    }
  56. {    creator and file type of the new file.  This function is needed to        }
  57. {    create a file in an AppleShare "drop box" where the user can make        }
  58. {    changes, but cannot see folder or files.                                }
  59. {                                                                            }
  60. {    vRefNum        input:    Volume specification.                                }
  61. {    dirID        input:    Directory ID.                                        }
  62. {    fileName    input:    The name of the new file.                            }
  63.  
  64.  
  65. {***************************************************************************}
  66.  
  67.  
  68.     FUNCTION FSpCreateMinimum ({CONST}VAR spec: FSSpec): OSErr;
  69. {    Use FSpCreateMinimum to create a new file without attempting to set        }
  70. {    the creator and file type of the new file.  This function is needed to    }
  71. {    create a file in an AppleShare "dropbox" where the user can make        }
  72. {    changes, but cannot see folder or files.                                }
  73. {                                                                            }
  74. {    spec        input:    An FSSpec record specifying the file to create.        }
  75.  
  76.  
  77. {***************************************************************************}
  78.  
  79.  
  80.     FUNCTION ExchangeFiles (vRefNum: Integer;
  81.                                     srcDirID: LongInt;
  82.                                     srcName: Str255;
  83.                                     dstDirID: LongInt;
  84.                                     dstName: Str255): OSErr;
  85. {    Use ExchangeFiles to exchange the data stored in two files on the        }
  86. {    same volume.                                                            }
  87. {                                                                            }
  88. {    vRefNum        input:    Volume specification.                                }
  89. {    srcDirID    input:    Source directory ID.                                }
  90. {    srcName        input:    Source file name.                                    }
  91. {    dstDirID    input:    Destination directory ID.                            }
  92. {    dstName        input:    Destination file name.                                }
  93.  
  94.  
  95. {***************************************************************************}
  96.  
  97.  
  98.     FUNCTION ResolveFileIDRef (volName: StringPtr;
  99.                                     vRefNum: Integer;
  100.                                     fileID: LongInt;
  101.                                     VAR parID: LongInt;
  102.                                     fileName: StringPtr): OSErr;
  103. {    Use ResolveFileIDRef to retrieve the filename and parent directory ID    }
  104. {    of the file with the specified file ID.                                    }
  105. {                                                                            }
  106. {    volName    input:    A pointer to the name of a mounted volume                }
  107. {                    or nil.                                                    }
  108. {    fileID    input:    The file ID.                                            }
  109. {    vRefNum    input:    Volume specification.                                    }
  110. {    parID    output:    The parent directory ID of the file.                    }
  111. {    name    input:    Points to a buffer (minimum Str63) where the filename    }
  112. {                    is to be returned or must be nil.                        }
  113. {            output:    The filename.                                            }
  114.  
  115.  
  116. {***************************************************************************}
  117.  
  118.  
  119.     FUNCTION CreateFileIDRef (vRefNum: Integer;
  120.                                     parID: LongInt;
  121.                                     fileName: Str255;
  122.                                     VAR fileID: LongInt): OSErr;
  123. {    Use CreateFileIDRef to establish a file ID for a file.                    }
  124. {                                                                            }
  125. {    vRefNum        input:    Volume specification.                                }
  126. {    parID        input:    Directory ID.                                        }
  127. {    fileName    input:    The name of the file.                                }
  128. {    fileID        output:    The file ID.                                        }
  129.  
  130.  
  131. {***************************************************************************}
  132.  
  133.  
  134.     FUNCTION FSpCreateFileIDRef ({CONST}VAR spec: FSSpec;
  135.                                     VAR fileID: LongInt): OSErr;
  136. {    Use FSpCreateFileIDRef to establish a file ID for a file.                }
  137. {                                                                            }
  138. {    spec        input:    An FSSpec record specifying the file.                }
  139. {    fileID        output:    The file ID.                                        }
  140.  
  141.  
  142. {***************************************************************************}
  143.  
  144.  
  145.     FUNCTION DeleteFileIDRef (volName: StringPtr;
  146.                                     vRefNum: Integer;
  147.                                     fileID: LongInt): OSErr;
  148. {    Use DeleteFileIDRef to delete a file ID reference.                        }
  149. {                                                                            }
  150. {    volName    input:    A pointer to the name of a mounted volume                }
  151. {                    or nil.                                                    }
  152. {    vRefNum    input:    Volume specification.                                    }
  153. {    fileID    input:    The file ID.                                            }
  154.  
  155.  
  156. {***************************************************************************}
  157.  
  158.  
  159.     FUNCTION FlushFile (refNum: Integer): OSErr;
  160. {    Write the contents of a file's access path buffer (the fork data).        }
  161. {    The FlushFile function writes the contents of a file's access path        }
  162. {    buffer (the fork data) to the volume. Note: some of the file's catalog    }
  163. {    information stored on the volume may not be correct until FlushVol        }
  164. {    is called.                                                                }
  165. {                                                                            }
  166. {    refNum    input:    The file reference number of an open file.                }
  167.  
  168.  
  169. {***************************************************************************}
  170.  
  171.  
  172.     FUNCTION LockRange (refNum: Integer;
  173.                                     rangeLength: LongInt;
  174.                                     rangeStart: LongInt): OSErr;
  175. {    Use LockRange to lock a portion of a file.                                }
  176. {                                                                            }
  177. {    refNum        input:    The file reference number of an open file.            }
  178. {    rangeLength    input:    The number of bytes in the range.                    }
  179. {    rangeStart    input:    The starting byte in the range to lock.                }
  180.  
  181.  
  182. {***************************************************************************}
  183.  
  184.  
  185.     FUNCTION UnlockRange (refNum: Integer;
  186.                                     rangeLength: LongInt;
  187.                                     rangeStart: LongInt): OSErr;
  188. {    Use UnlockRange to unlock a previously locked range.                    }
  189. {                                                                            }
  190. {    refNum        input:    The file reference number of an open file.            }
  191. {    rangeLength    input:    The number of bytes in the range.                    }
  192. {    rangeStart    input:    The starting byte in the range to unlock.            }
  193.  
  194.  
  195. {***************************************************************************}
  196.  
  197.  
  198.     FUNCTION GetForeignPrivs (vRefNum: Integer;
  199.                                     dirID: LongInt;
  200.                                     name: StringPtr;
  201.                                     foreignPrivBuffer: Ptr;
  202.                                     VAR foreignPrivSize: LongInt;
  203.                                     VAR foreignPrivInfo1: LongInt;
  204.                                     VAR foreignPrivInfo2: LongInt;
  205.                                     VAR foreignPrivInfo3: LongInt;
  206.                                     VAR foreignPrivInfo4: LongInt): OSErr;
  207. {    Use GetForeignPrivs to determine the native access-control                }
  208. {    information for a file or directory stored on a volume managed by        }
  209. {    a foreign file system.                                                    }
  210. {                                                                            }
  211. {    vRefNum                input:    Volume specification.                        }
  212. {    dirID                input:    Directory ID.                                }
  213. {    name                input:    Pointer to object name, or nil when dirID    }
  214. {                                specifies a directory that's the object.    }
  215. {    foreignPrivBuffer    input:    Pointer to buffer where the privilege        }
  216. {                                information is returned.                    }
  217. {                        output:    Privilege information.                        }
  218. {    foreignPrivSize        input:    Size of buffer pointed to by                }
  219. {                                foreignPrivBuffer.                            }
  220. {                        output: Amount of buffer actually used.                }
  221. {    foreignPrivInfo1    output:    Information specific to privilege model.    }
  222. {    foreignPrivInfo2    output:    Information specific to privilege model.    }
  223. {    foreignPrivInfo3    output:    Information specific to privilege model.    }
  224. {    foreignPrivInfo4    output:    Information specific to privilege model.    }
  225.  
  226.  
  227. {***************************************************************************}
  228.  
  229.  
  230.     FUNCTION FSpGetForeignPrivs ({CONST}VAR spec: FSSpec;
  231.                                     foreignPrivBuffer: Ptr;
  232.                                     VAR foreignPrivSize: LongInt;
  233.                                     VAR foreignPrivInfo1: LongInt;
  234.                                     VAR foreignPrivInfo2: LongInt;
  235.                                     VAR foreignPrivInfo3: LongInt;
  236.                                     VAR foreignPrivInfo4: LongInt): OSErr;
  237. {    Use FSpGetForeignPrivs to determine the native access-control            }
  238. {    information for a file or directory stored on a volume managed by        }
  239. {    a foreign file system.                                                    }
  240. {                                                                            }
  241. {    spec                input:    An FSSpec record specifying the object.        }
  242. {    foreignPrivBuffer    input:    Pointer to buffer where the privilege        }
  243. {                                information is returned.                    }
  244. {                        output:    Privilege information.                        }
  245. {    foreignPrivSize        input:    Size of buffer pointed to by                }
  246. {                                foreignPrivBuffer.                            }
  247. {                        output: Amount of buffer actually used.                }
  248. {    foreignPrivInfo1    output:    Information specific to privilege model.    }
  249. {    foreignPrivInfo2    output:    Information specific to privilege model.    }
  250. {    foreignPrivInfo3    output:    Information specific to privilege model.    }
  251. {    foreignPrivInfo4    output:    Information specific to privilege model.    }
  252.  
  253.  
  254.  
  255. {***************************************************************************}
  256.  
  257.  
  258.     FUNCTION SetForeignPrivs (vRefNum: Integer;
  259.                                     dirID: LongInt;
  260.                                     name: StringPtr;
  261.                                     foreignPrivBuffer: Ptr;
  262.                                     VAR foreignPrivSize: LongInt;
  263.                                     foreignPrivInfo1: LongInt;
  264.                                     foreignPrivInfo2: LongInt;
  265.                                     foreignPrivInfo3: LongInt;
  266.                                     foreignPrivInfo4: LongInt): OSErr;
  267. {    Use SetForeignPrivs to change the native access-control information        }
  268. {    for a file or directory stored on a volume managed by a foreign            }
  269. {    file system.                                                            }
  270. {                                                                            }
  271. {    vRefNum                input:    Volume specification.                        }
  272. {    dirID                input:    Directory ID.                                }
  273. {    name                input:    Pointer to object name, or nil when dirID    }
  274. {                                specifies a directory that's the object.    }
  275. {    foreignPrivBuffer    input:    Pointer to privilege information buffer.    }
  276. {    foreignPrivSize        input:    Size of buffer pointed to by                }
  277. {                                foreignPrivBuffer.                            }
  278. {                        output: Amount of buffer actually used.                }
  279. {    foreignPrivInfo1    input:    Information specific to privilege model.    }
  280. {    foreignPrivInfo2    input:    Information specific to privilege model.    }
  281. {    foreignPrivInfo3    input:    Information specific to privilege model.    }
  282. {    foreignPrivInfo4    input:    Information specific to privilege model.    }
  283.  
  284.  
  285. {***************************************************************************}
  286.  
  287.  
  288.     FUNCTION FSpSetForeignPrivs ({CONST}VAR spec: FSSpec;
  289.                                     foreignPrivBuffer: Ptr;
  290.                                     VAR foreignPrivSize: LongInt;
  291.                                     foreignPrivInfo1: LongInt;
  292.                                     foreignPrivInfo2: LongInt;
  293.                                     foreignPrivInfo3: LongInt;
  294.                                     foreignPrivInfo4: LongInt): OSErr;
  295. {    Use FSpSetForeignPrivs to change the native access-control information    }
  296. {    for a file or directory stored on a volume managed by a foreign            }
  297. {    file system.                                                            }
  298. {                                                                            }
  299. {    spec                input:    An FSSpec record specifying the object.        }
  300. {    foreignPrivBuffer    input:    Pointer to privilege information buffer.    }
  301. {    foreignPrivSize        input:    Size of buffer pointed to by                }
  302. {                                foreignPrivBuffer.                            }
  303. {                        output: Amount of buffer actually used.                }
  304. {    foreignPrivInfo1    input:    Information specific to privilege model.    }
  305. {    foreignPrivInfo2    input:    Information specific to privilege model.    }
  306. {    foreignPrivInfo3    input:    Information specific to privilege model.    }
  307. {    foreignPrivInfo4    input:    Information specific to privilege model.    }
  308.  
  309.  
  310. {***************************************************************************}
  311.  
  312.  
  313.     FUNCTION HGetLogInInfo (volName: StringPtr;
  314.                                     vRefNum: Integer;
  315.                                     VAR loginMethod: Integer;
  316.                                     userName: StringPtr): OSErr;
  317. {    Use HGetLogInInfo to determine the login method and user name used to    }
  318. {    log on to a particular shared volume.                                    }
  319. {                                                                            }
  320. {    volName        input:    A pointer to the name of a mounted volume            }
  321. {                        or nil.                                                }
  322. {    vRefNum        input:    The volume reference number.                        }
  323. {    loginMethod    output:    The login method used (kNoUserAuthentication,        }
  324. {                        kPassword, kEncryptPassword, or                        }
  325. {                        kTwoWayEncryptPassword).                            }
  326. {    userName    input:    Points to a buffer (minimum Str31) where the user    }
  327. {                        name is to be returned or must be nil.                }
  328. {                output:    The user name.                                        }
  329.  
  330.  
  331. {***************************************************************************}
  332.  
  333.  
  334.     FUNCTION HGetDirAccess (vRefNum: Integer;
  335.                                     dirID: LongInt;
  336.                                     name: StringPtr;
  337.                                     VAR ownerID: LongInt;
  338.                                     VAR groupID: LongInt;
  339.                                     VAR accessRights: LongInt): OSErr;
  340. {    Use HGetDirAccess to get the directory access control information for    }
  341. {    a directory on a shared volume.                                            }
  342. {                                                                            }
  343. {    vRefNum            input:    Volume specification.                            }
  344. {    dirID            input:    Directory ID.                                    }
  345. {    name            input:    Pointer to directory name, or nil if dirID        }
  346. {                            specifies the directory.                        }
  347. {    ownerID            output:    The directory's owner ID.                        }
  348. {    groupID            output:    The directory's group ID or                        }
  349. {                            0 if no group affiliation.                        }
  350. {    accessRights    output:    The directory's access rights.                    }
  351.  
  352.  
  353. {***************************************************************************}
  354.  
  355.  
  356.     FUNCTION FSpGetDirAccess ({CONST}VAR spec: FSSpec;
  357.                                     VAR ownerID: LongInt;
  358.                                     VAR groupID: LongInt;
  359.                                     VAR accessRights: LongInt): OSErr;
  360. {    Use FSpGetDirAccess to get the directory access control information        }
  361. {    for a directory on a shared volume.                                        }
  362. {                                                                            }
  363. {    spec            input:    An FSSpec record specifying the directory.        }
  364. {    ownerID            output:    The directory's owner ID.                        }
  365. {    groupID            output:    The directory's group ID or                        }
  366. {                            0 if no group affiliation.                        }
  367. {    accessRights    output:    The directory's access rights.                    }
  368.  
  369.  
  370. {***************************************************************************}
  371.  
  372.  
  373.     FUNCTION HSetDirAccess (vRefNum: Integer;
  374.                                     dirID: LongInt;
  375.                                     name: StringPtr;
  376.                                     ownerID: LongInt;
  377.                                     groupID: LongInt;
  378.                                     accessRights: LongInt): OSErr;
  379. {    Use HSetDirAccess to change the directory access control information    }
  380. {    for a directory on a shared volume.                                        }
  381. {                                                                            }
  382. {    vRefNum            input:    Volume specification.                            }
  383. {    dirID            input:    Directory ID.                                    }
  384. {    name            input:    Pointer to directory name, or nil if dirID        }
  385. {                            specifies the directory.                        }
  386. {    ownerID            output:    The directory's owner ID.                        }
  387. {    groupID            output:    The directory's group ID or                        }
  388. {                            0 if no group affiliation.                        }
  389. {    accessRights    output:    The directory's access rights.                    }
  390.  
  391.  
  392. {***************************************************************************}
  393.  
  394.  
  395.     FUNCTION FSpSetDirAccess ({CONST}VAR spec: FSSpec;
  396.                                     ownerID: LongInt;
  397.                                     groupID: LongInt;
  398.                                     accessRights: LongInt): OSErr;
  399. {    Use FSpSetDirAccess to change the directory access control information    }
  400. {    for a directory on a shared volume.                                        }
  401. {                                                                            }
  402. {    spec            input:    An FSSpec record specifying the directory.        }
  403. {    ownerID            output:    The directory's owner ID.                        }
  404. {    groupID            output:    The directory's group ID or                        }
  405. {                            0 if no group affiliation.                        }
  406. {    accessRights    output:    The directory's access rights.                    }
  407.  
  408.  
  409. {***************************************************************************}
  410.  
  411.  
  412.     FUNCTION HMapID (volName: StringPtr;
  413.                                     vRefNum: Integer;
  414.                                     ugID: LongInt;
  415.                                     objType: Integer;
  416.                                     name: StringPtr): OSErr;
  417. {    Use HMapID to determine the name of a user or group if you know the        }
  418. {    user or group ID.                                                        }
  419. {                                                                            }
  420. {    volName        input:    A pointer to the name of a mounted volume            }
  421. {                        or nil.                                                }
  422. {    vRefNum        input:    Volume specification.                                }
  423. {    objType        input:    The mapping function code: 1 if you're mapping a    }
  424. {                        user ID to a user name or 2 if you're mapping a        }
  425. {                        group ID to a group name.                            }
  426. {    name        input:    Points to a buffer (minimum Str31) where the user    }
  427. {                        or group name is to be returned or must be nil.        }
  428. {                output:    The user or group name.                                }
  429.  
  430.  
  431. {***************************************************************************}
  432.  
  433.  
  434.     FUNCTION HMapName (volName: StringPtr;
  435.                                     vRefNum: Integer;
  436.                                     name: Str255;
  437.                                     objType: Integer;
  438.                                     VAR ugID: LongInt): OSErr;
  439. {    Use HMapName to determine the user or group ID if you know the user or    }
  440. {    group name.                                                                }
  441. {                                                                            }
  442. {    volName        input:    A pointer to the name of a mounted volume            }
  443. {                        or nil.                                                }
  444. {    vRefNum        input:    Volume specification.                                }
  445. {    name        input:    The user or group name.                                }
  446. {    objType        input:    The mapping function code: 3 if you're mapping a    }
  447. {                        user name to a user ID or 4 if you're mapping a        }
  448. {                        group name to a group ID.                            }
  449. {    ID            output:    The user or group ID.                                }
  450.  
  451.  
  452. {***************************************************************************}
  453.  
  454.  
  455.     FUNCTION HCopyFile (srcVRefNum: Integer;
  456.                                     srcDirID: LongInt;
  457.                                     srcName: Str255;
  458.                                     dstVRefNum: Integer;
  459.                                     dstDirID: LongInt;
  460.                                     dstPathname: StringPtr;
  461.                                     copyName: StringPtr): OSErr;
  462. {    Use HCopyFile to duplicate a file and optionally to rename it.            }
  463. {    The source and destination volumes must be on the same file server.        }
  464. {                                                                            }
  465. {    srcVRefNum    input:    Source volume specification.                        }
  466. {    srcDirID    input:    Source directory ID.                                }
  467. {    srcName        input:    Source file name.                                    }
  468. {    dstVRefNum    input:    Destination volume specification.                    }
  469. {    dstDirID    input:    Destination directory ID.                            }
  470. {    dstPathname    input:    Pointer to destination directory name, or            }
  471. {                        nil when dstDirID specifies a directory.            }
  472. {    copyName    input:    Points to the new file name if the file is to be    }
  473. {                        renamed or nil if the file isn't to be renamed.        }
  474.  
  475.  
  476. {***************************************************************************}
  477.  
  478.  
  479.     FUNCTION FSpCopyFile ({CONST}VAR srcSpec: FSSpec;
  480.                                     {CONST}VAR dstSpec: FSSpec;
  481.                                     copyName: StringPtr): OSErr;
  482. {    Use FSpCopyFile to duplicate a file and optionally to rename it.        }
  483. {    The source and destination volumes must be on the same file server.        }
  484. {                                                                            }
  485. {    srcSpec        input:    An FSSpec record specifying the source file.        }
  486. {    dstSpec        input:    An FSSpec record specifying the destination            }
  487. {                        directory.                                            }
  488. {    copyName    input:    Points to the new file name if the file is to be    }
  489. {                        renamed or nil if the file isn't to be renamed.        }
  490.  
  491.  
  492. {***************************************************************************}
  493.  
  494.  
  495.     FUNCTION HMoveRename (vRefNum: Integer;
  496.                                     srcDirID: LongInt;
  497.                                     srcName: Str255;
  498.                                     dstDirID: LongInt;
  499.                                     dstpathName: StringPtr;
  500.                                     copyName: StringPtr): OSErr;
  501. {    Use HMoveRename to move a file or directory and optionally to rename    }
  502. {    it.  The source and destination locations must be on the same shared    }
  503. {    volume.                                                                    }
  504. {                                                                            }
  505. {    vRefNum        input:    Volume specification.                                }
  506. {    srcDirID    input:    Source directory ID.                                }
  507. {    srcName        input:    The source object name.                                }
  508. {    dstDirID    input:    Destination directory ID.                            }
  509. {    dstName        input:    Pointer to destination directory name, or            }
  510. {                        nil when dstDirID specifies a directory.            }
  511. {    copyName    input:    Points to the new name if the object is to be        }
  512. {                        renamed or nil if the object isn't to be renamed.    }
  513.  
  514.  
  515. {***************************************************************************}
  516.  
  517.  
  518.     FUNCTION FSpMoveRename ({CONST}VAR srcSpec: FSSpec;
  519.                                     {CONST}VAR dstSpec: FSSpec;
  520.                                     copyName: StringPtr): OSErr;
  521. {    Use FSpMoveRename to move a file or directory and optionally to            }
  522. {    rename it. The source and destination locations must be on the same        }
  523. {    shared volume.                                                            }
  524. {                                                                            }
  525. {    srcSpec        input:    An FSSpec record specifying the source object.        }
  526. {    dstSpec        input:    An FSSpec record specifying the destination            }
  527. {                        directory.                                            }
  528. {    copyName    input:    Points to the new name if the object is to be        }
  529. {                        renamed or nil if the object isn't to be renamed.    }
  530.  
  531.  
  532. {***************************************************************************}
  533.  
  534.  
  535.     FUNCTION GetVolMountInfoSize (volName: StringPtr;
  536.                                     vRefNum: Integer;
  537.                                     VAR size: Integer): OSErr;
  538. {    Use GetVolMountInfoSize to determine the how much space to allocate        }
  539. {    for a volume mounting information record.                                }
  540. {                                                                            }
  541. {    volName        input:    A pointer to the name of a mounted volume            }
  542. {                        or nil.                                                }
  543. {    vRefNum        input:    Volume specification.                                }
  544. {    size        output:    The space needed (in bytes) of the volume mounting    }
  545. {                        information record.                                    }
  546.  
  547.  
  548. {***************************************************************************}
  549.  
  550.  
  551.     FUNCTION GetVolMountInfo (volName: StringPtr;
  552.                                     vRefNum: Integer;
  553.                                     volMountInfo: Ptr): OSErr;
  554. {    Use GetVolMountInfo to retrieve a volume mounting information record    }
  555. {    containing all the information needed to mount the volume, except        }
  556. {    for passwords.                                                            }
  557. {                                                                            }
  558. {    volName            input:    A pointer to the name of a mounted volume        }
  559. {                            or nil.                                            }
  560. {    vRefNum            input:    Volume specification.                            }
  561. {    volMountInfo    output:    Points to a volume mounting information            }
  562. {                            record where the mounting information is to        }
  563. {                            be returned.                                    }
  564.  
  565.  
  566. {***************************************************************************}
  567.  
  568.  
  569.     FUNCTION VolumeMount (volMountInfo: Ptr;
  570.                                     VAR vRefNum: Integer): OSErr;
  571. {    Use VolumeMount to mount a volume using a volume mounting information    }
  572. {    record.                                                                    }
  573. {                                                                            }
  574. {    volMountInfo    inout:    Points to a volume mounting information record.    }
  575. {    vRefNum            output:    A volume reference number.                        }
  576.  
  577.  
  578. {***************************************************************************}
  579.  
  580.  
  581.     FUNCTION Share (vRefNum: Integer;
  582.                                     dirID: LongInt;
  583.                                     name: StringPtr): OSErr;
  584. {    Use Share to establish a local volume or directory as a share point.    }
  585. {                                                                            }
  586. {    vRefNum            input:    Volume specification.                            }
  587. {    dirID            input:    Directory ID.                                    }
  588. {    name            input:    Pointer to directory name, or nil if dirID        }
  589. {                            specifies the directory.                        }
  590.  
  591.  
  592. {***************************************************************************}
  593.  
  594.  
  595.     FUNCTION FSpShare ({CONST}VAR spec: FSSpec): OSErr;
  596. {    Use FSpShare to establish a local volume or directory as a share point.    }
  597. {                                                                            }
  598. {    spec    input:    An FSSpec record specifying the share point.            }
  599.  
  600.  
  601. {***************************************************************************}
  602.  
  603.  
  604.     FUNCTION Unshare (vRefNum: Integer;
  605.                                     dirID: LongInt;
  606.                                     name: StringPtr): OSErr;
  607. {    Use Unshare to remove a share point.                                    }
  608. {                                                                            }
  609. {    vRefNum            input:    Volume specification.                            }
  610. {    dirID            input:    Directory ID.                                    }
  611. {    name            input:    Pointer to directory name, or nil if dirID        }
  612. {                            specifies the directory.                        }
  613.  
  614.  
  615. {***************************************************************************}
  616.  
  617.  
  618.     FUNCTION FSpUnshare ({CONST}VAR spec: FSSpec): OSErr;
  619. {    Use FSpUnshare to remove a share point.                                    }
  620. {                                                                            }
  621. {    spec    input:    An FSSpec record specifying the share point.            }
  622.  
  623.  
  624. {***************************************************************************}
  625.  
  626.  
  627.     FUNCTION GetUGEntry (objType: Integer;
  628.                                     objName: StringPtr;
  629.                                     VAR objID: LongInt): OSErr;
  630. {    Use GetUGEntry to get a list of user or group entries from the            }
  631. {    local file server.                                                        }
  632. {                                                                            }
  633. {    objType        input:    The object type: -1 = group; 0 = user                }
  634. {    objName        input:    Points to a buffer (minimum Str31) where the user    }
  635. {                        or group name is to be returned or must be nil.        }
  636. {                output:    The user or group name.                                }
  637. {    objID        input:    O to get the first user or group. If the entry        }
  638. {                        objID last returned by GetUGEntry is passed, then    }
  639. {                        user or group whose alphabetically next in the list    }
  640. {                        of entries is returned.                                }
  641. {                output:    The user or group ID.                                }
  642.  
  643.  
  644. {***************************************************************************}
  645.  
  646. IMPLEMENTATION
  647.  
  648. END.